#include <iostream>
#include <vector>
#include <algorithm>
#include <list>

#include "NumericStatistics.h"

using namespace std;


#ifdef __TEST__

int main( )
{
   list<int> data( 100000 );

   // create random numbers
   generate( data.begin(), data.end(), rand );

   // make them go from 0 to 200
   transform( data.begin(), data.end(), data.begin(),
      bind2nd( modulus<int>(), 201 ) );

   // make them go from -100 to 100
   transform( data.begin(), data.end(), data.begin(),
      bind2nd( minus<int>(), 100 ) );

   // gather the statistics
   NumericStatistics stats = for_each( data.begin(), data.end(),
     NumericStatistics() );

   // print the statistics
   cout << "Mean = " << stats.mean()
      << "\nVariance = " << stats.variance() << endl;
}

#endif // __TEST__

// EOF
